<?
session_start();
if(!session_is_registered("myusername")){
    header("location:index.php");
}
else{
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html lang="fr">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Notation des commerces de Mons >> Notez</title>
        <link rel="stylesheet" href="./mystyle.css" type="text/css" media="screen" />
    </head>
    <body>
        <?
        include 'myheader.php';
        ?>
        <center>
            <?
            include 'connect_db.php';

            $sql="SELECT * FROM $table_type ORDER BY idtype";
            $result=mysql_query($sql);

            echo "<form name=form2 method=post action=send_notes.php>";

            while($tableau=mysql_fetch_array($result,MYSQL_ASSOC)){
                echo "<div id='colonne1' align='center' class='colonnem'>";
                echo "<br>1 = Mauvais,à déconseiller; 5 = excellent, à recommander.</br>";
                echo '<h2>', $tableau['name'], '</h2>';
                $sql="select items.iditems,items.name,items.street,items.number,cities.zip,cities.name as 'cityname' from items inner join cities on items.cities_idcities=cities.idcities WHERE type_idtype=$tableau[idtype] ORDER BY items.name";
                $result1=mysql_query($sql);

                echo '<TABLE BORDER=0>';
                echo '<TR><TD><b>Votre note</b></TD><TD><b>Nom</b></TD><TD><b>Adresse</b></TD><TD><b>Code postal</b></TD><TD><b>Ville</b></TD></TR>';
                while($tableau1=mysql_fetch_array($result1,MYSQL_ASSOC)){
                    echo '<TR><TD><select name=drop',$tableau1['iditems'],
                                                        ' id=vdrop',$tableau1['iditems'],'><option>Ne pas modifier la note</option>
                                                        <option>1</option>
                                                        <option>2</option>
                                                        <option>3</option>
                                                        <option>4</option>
                                                        <option>5</option>
                                                        </select></TD><TD>',$tableau1['name'],'</TD><TD><small>',$tableau1['street'],',',$tableau1['number'],'</small></TD><TD><small>',$tableau1['zip'],'</small></TD><TD><small>',$tableau1['cityname'],'</small></TD>';
                }
                echo '</TABLE>';
                echo '</div>';
            }
                                        /*
                                        echo '<TABLE BORDER=0>';
                                        echo '<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>';

                                        echo '</TABLE>';
                                         * */

            echo '<td><input type="submit" name="Submit" value="Soumettre mes évaluations"></td>';
            echo "</form>";

            mysql_close($link);

            ?>
        </center>
    </body>
</html> 
